<?php

namespace app\wanqing\model;

use think\Model;

class WanqingVirtualAddressModel extends Model
{
    /* 自动处理时间 */
    protected $autoWriteTimestamp = 'int';

    protected $insert = ['uid'];

    protected function setUidAttr($fields)
    {
        if(!$fields) {
            return cmf_get_current_admin_id();
        }
        return $fields;
    }

    protected function setStartTimeAttr($fields)
    {
        return strtotime($fields);
    }

    protected function setEndtimeAttr($fields)
    {
        return strtotime($fields);
    }
}